    module assoc_arr_1;

       int temp,imem[*];

       initial
       begin
//          imem[ 2'd3 ] = 1;
//          imem[ 16'hffff ] = 2;
//          imem[ 4'b1000 ] = 3;

          imem[ 3 ] = 1;
          imem[ 65535 ] = 2;
          imem[ 8 ] = 3;

          $display( "%0d entries", imem.num );

          if(imem.exists( 4'b1000) )
              $display("imem.exists( 4b'1000) ");

          imem.delete(8);

          if(imem.exists( 4'b1000) )
              $display(" imem.exists( 4b'1000) ");
          else
              $display(" (4b'1000) not existing");

          if(imem.first(temp))
              $display(" First entry is at index %0db ",temp);

          if(imem.next(temp))
              $display(" Next entry is at index %0h after the index 3",temp);
          // To print all the elements alone with its indexs

          if (imem.first(temp) )
          do
              $display( "%d : %d", temp, imem[temp] );
          while ( imem.next(temp) );

       end
    endmodule
